const {
	request,
} = require('@utils/apis')
const {
	getItemList,
	addTaskItem,
} = require('@utils/leangoo')

module.exports = {

	loginAction(cxt, params) {
		let reqPro = request('API_LOGIN', params)
		return reqPro.then(result => {
			cxt.commit('LOG_IN', result.info)
		})
	},

	logoutAction(cxt) {
		cxt.commit('LOG_OUT')
	},

	datasAction(cxt) {
		getItemList().then((datas) => {
			cxt.state.datas = datas;
			console.log('datas', datas)
			// cxt.commit('TASK_ITEM_LIST', result)
		})
	},

	addItemAction(cxt, params) {
		addTaskItem(params)
	},
}